from datetime import datetime
from typing import Optional

from pydantic import BaseModel, Field



class NoticeSchema(BaseModel):
    content: str = Field(description="公告内容", min_length=2, max_length=1000)
    status: int = Field(description="公告状态")
    publish_time: datetime = Field(description="发布时间")

    class Config:
        from_attributes = True  # 启用 orm_mode 以支持 SQLAlchemy 模型


class ResNoticeSchema(NoticeSchema):
    id: int
